package Models

type GZPCService struct {
	Id          int64    `json:"id" gorm:"primary_key"`
	Qq          string   `json:"qq" gorm:"size:32"`
	ThumbId     int64    `json:"thumb_id" gorm:"type:int;size:4"`
	Nickname    string   `json:"nickname"`
	Phone       string   `json:"phone"`
	PromptText  string   `json:"prompt_text"`
	ServiceType int      `json:"service_type"`
	IsEnable    IsEnable `json:"is_enable"`
	Closed      int64    `json:"closed"`
	CreatedAt   int64    `json:"create_time"`
	UpdatedAt   int64    `json:"update_time"`
}

func (GZPCService) TableName() string {
	return "gz_shop_pc_service"
}

func CustomService() GZPCService {
	var r GZPCService
	w := map[string]any{
		"service_type": 1,
		"closed":       0,
	}
	DB.Where(w).Select("id,thumb_id,prompt_text").Find(&r)
	return r
}

func CustomTel() GZPCService {
	var r GZPCService
	w := map[string]any{
		"service_type": 2,
		"closed":       0,
	}
	DB.Where(w).Select("id,phone,prompt_text").Find(&r)
	return r
}

func CustomQq() GZPCService {
	var r GZPCService
	w := map[string]any{
		"service_type": 0,
		"closed":       0,
	}
	DB.Where(w).Select("id,qq,nickname").Find(&r)
	return r
}
